﻿using System;
using Pharmacy.Data;
using Pharmacy.Entities;

public partial class Admin_ExportRevenueDetail : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            DateTime fromdate = DateTime.Now.AddMonths(-1);
            txttodate.Text = DateTime.Now.ToString("dd-MMM-yyyy");
            txtfromdate.Text = fromdate.ToString("dd-MMM-yyyy");
        }
    }

    protected void DetailDataSource_Selecting(object sender, System.Web.UI.WebControls.ObjectDataSourceSelectingEventArgs e)
    {
        if (!IsPostBack)
        {
            e.Cancel = true;
        }
    }
    protected void btnview_Click(object sender, EventArgs e)
    {
        DateTime fromDate = Convert.ToDateTime(txtfromdate.Text);
        DateTime toDate = Convert.ToDateTime(txttodate.Text);
        string whereClause = string.Format("DeliveryDate between '{0}' and '{1}'", fromDate.ToString("yyyy-MM-dd"),
                                           toDate.ToString("yyyy-MM-dd"));
        hf_DetailWhereClause.Value = whereClause;
    }
}
